using System;

namespace RBT
{
    /// <summary>
    /// Encapsulates a nextNode in the tree
    /// </summary>
    public class RBTreeNode
    {
        /// <summary>
        /// Tree's next node color.
        /// Red = 0
        /// </summary>
        public static int Red;
        /// <summary>
        /// Black = 1
        /// </summary>
        public static int Black = 1;
        /// <summary>
        /// Key provided by the calling class
        /// </summary>
        public IComparable Key { get; set; }
        /// <summary>
        /// The data or value associated with the key
        /// </summary>
        public object Data { get; set; }
        /// <summary>
        /// Color used to balance the tree
        /// </summary>
        public int Color { get; set; }
        /// <summary>
        /// Left
        /// </summary>
        public RBTreeNode Left { get; set; }
        /// <summary>
        /// Right
        /// </summary>
        public RBTreeNode Right { get; set; }
        /// <summary>
        /// Parent
        /// </summary>
        public RBTreeNode Parent { get; set; }
        /// <summary>
        /// Constructor
        /// </summary>
        public RBTreeNode()
        {
            Color = Red;
        }
    }
}